<!--
 * @Author: coman
 * @LastEditors: coman
 * @Date: 2020-06-20 15:16:07
 * @motto: No pain,No gain
 * @LastEditTime: 2020-06-20 16:21:22
--> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            height: 1000px;
        }
        *{
            margin: 0;
            padding: 0;
        }
        input{
            outline: none;
        }
        .logo{
            width: 262px;
            height: 72px;
            float: left;
            margin-right: 95px;
        }
        .logo img{
            width: 100%;
            height: 100%;
        }
        .search-wrap{
           width: 1350px;
           height: 200px;
           margin: 30px auto;
           margin-right: 95px;
           background: yellow;
        }
       .search{
        height: 72px;
       }
        input{
            width: 700px;
            border: 3px solid orangered;
        }
    </style>
</head>
<body>
    
 <div class="search-wrap">
    <div class="search" id="search">
        <h1 class="logo"><img src="../images/logo.png" alt=""></h1>
        <input type="text">
    </div>
    </div>
    <script>
        window.onscroll=function(){
            if(scrollY>200){
                search.style.position="fixed";
                search.style.top='0';
            }else{
                search.style.position="";
                search.style.top='';
            }
            
        }
    </script>
</body>
</html>